/*
 ============================================================================
 Page	     : 144
 Name        : cmpflt.c
 Date	     : 20210403
 Author      : Hbue 18060333
 Copyright   : Your copyright notice
 Description : 浮点数比较
 ============================================================================
 */

#include <stdio.h>
#include <math.h>

int main(void)
{
	const double ANSWER = 3.14159;
	double response = 0;

	printf("What is the value of pi?\n");
	scanf("%lf", &response);
	while(fabs(response - ANSWER) > 0.0001)
	{
		printf("Try again!\n");
		scanf("%lf", &response);
	}
	printf("Close enough!\n");

	return 0;
}

